;
; SYSLIB Module Name:  SLOUT
; Author:  Richard Conn
; SYSLIB Version Number:  2.0
; Module Version Number:  1.0
; Module Entry Points:
;	LOUT
; Module External References:
;	None
;

;
;  LOUT -- 
;	LIST OUTPUT ROUTINE
;	OUTPUT CHAR IN REG A TO LST:
;	AFFECT NO REGISTERS OR FLAGS
;
PUTRG	MACRO
	PUSH	B	; SAVE BC, DE, HL
	PUSH	D
	PUSH	H
	ENDM
GETRG	MACRO
	POP	H	; RESTORE HL, DE, BC
	POP	D
	POP	B
	ENDM

LOUT::
	PUSH	PSW	; SAVE REG A AND FLAGS
	PUTRG		; SAVE REGISTERS
	MOV	C,A	; CHAR IN C
	LHLD	JTABL	; GET ADDRESS OF JUMP TABLE
	MVI	L,L$OFF	; PRINTER OUTPUT ADR
	LXI	D,LRET	; SET UP RET ADR
	PUSH	D	; ... ON STACK
	PCHL
LRET:	GETRG		; RESTORE REGISTERS
	POP	PSW	; RESTORE REG A AND FLAGS
	RET

BOOT	EQU	0	; CP/M BOOT ADDRESS
JTABL	EQU	BOOT+1	; CP/M JUMP TABLE ADDRESS
L$OFF	EQU	0FH	; LIST OUTPUT OFFSET

	END
